﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;

namespace ExportExcelDemo.Core
{
    public class SchoolManager
    {

        public string GetSchoolNum(string schoolName)
        {
            var sql = @"select Num from School s where s.Name=@Name";
            SqlDataReader reader = SqlHelper.ExecuteReader(sql, System.Data.CommandType.Text, new System.Data.SqlClient.SqlParameter[] {
                new SqlParameter("@Name",schoolName)
            });

            string name = "";
            if (reader.Read())
            {
                name = reader.GetString(0);
            }
            return name;

        }

    }
}
